---
title: Scan
description: Scan items
keywords:
  - electrodb
  - docs
  - concepts
  - dynamodb
  - FilterExpression
  - ConditionExpression
  - scan
layout: ../../../layouts/MainLayout.astro
---

When scanning for rows, you can use filters the same as you would any query. For more information on filters, see the [Filters](/en/queries/filters) section.

The `scan` method will be scoped to your Entity. This means your results will only include records that match the Entity defined in the model.

> Fun Fact! Scanning DynamoDB is one of the least effective mechanisms for retrieving items from DynamoDB.

import ExampleSetup from "../../../partials/entity-query-example-setup.mdx";

<ExampleSetup />

```typescript
await StoreLocations.scan
  .where(
    ({ category }, { eq }) => `
        ${eq(category, "food/coffee")} OR ${eq(category, "spite store")}
    `,
  )
  .where(
    ({ leaseEndDate }, { between }) => `
        ${between(leaseEndDate, "2020-03", "2020-04")}
    `,
  )
  .go();
```

## Response Format

```typescript
{
  data: Array<YOUR_SCHEMA>,
  cursor: string | undefined
}
```

## Equivalent Parameters

```json
{
  "TableName": "StoreDirectory",
  "ExpressionAttributeNames": {
    "#category": "category",
    "#leaseEndDate": "leaseEndDate",
    "#pk": "pk",
    "#sk": "sk",
    "#__edb_e__": "__edb_e__",
    "#__edb_v__": "__edb_v__"
  },
  "ExpressionAttributeValues": {
    ":category_w1": "food/coffee",
    ":category_w2": "spite store",
    ":leaseEndDate_w1": "2020-03",
    ":leaseEndDate_w2": "2020-04",
    ":pk": "$mallstoredirectory#cityid_",
    ":sk": "$mallstore_1#buildingid_",
    ":__edb_e__": "MallStore",
    ":__edb_v__": "1"
  },
  "FilterExpression": "begins_with(#pk, :pk) AND #__edb_e__ = :__edb_e__ AND #__edb_v__ = :__edb_v__ AND begins_with(#sk, :sk) AND (#category = :category_w1 OR #category = :category_w2) AND (#leaseEndDate between :leaseEndDate_w1 and :leaseEndDate_w2)"
}
```

## Execution Options

import PartialExample from "../../../partials/query-options.mdx";

<PartialExample />
